<?phpclass principal{	private $tpl;	public function __construct($tpl)	{		$this->tpl = & $tpl;		$tpl->set('TITLE','INICIO');		//if(XAUTH::$user->role)		switch(XAUTH::$user->role)		{			case 'administrator':			$this->tpl->parse('principal/admin');			break;			case 'user':			$this->tpl->parse('principal/user');			break;			case 'guest':			default : 			$this->tpl->parse('principal/guest');		}			}	public function login()	{		if(XAUTH::$user->role == 'guest' && isset($_POST['login']) && !empty($_POST['login']['e']))		{			XAUTH::login($_POST['login']['e'],$_POST['login']['p']);			//if(!XAUTH::login($_POST['login']['e'],$_POST['login']['p']))			if(!XAUTH::$user->registered())			{				$this->tpl->assign('MSG','error');			}		}		return $this->tpl->render();	}	public function _default()	{				//$this->tpl->set('BODY',$this->tpl->render());		return $this->tpl->render();		//return 'metodo por default';			}}